package edu.bu.cs673.superkids123.children.model;

import java.util.Date;

import edu.bu.cs673.superkids123.common.model.Child;
import edu.bu.cs673.superkids123.parents.model.ActivityType;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name="activity")
public class Activity {
	/**
	 * @author Abdelghani Bhalla
	 */

	@Id @GeneratedValue
	@Column(name="ActivityID")
	private int id;
	
	@Column(name="ActivityTime")
	private Date time;
	
	@ManyToOne
	@JoinColumn(name="ActivityTypeID")
	@NotFound(action=NotFoundAction.IGNORE)
	private ActivityType activitytype;
	
	@ManyToOne
	@JoinColumn(name="UserID")
	@NotFound(action=NotFoundAction.IGNORE)
	private Child child;
	
	public int getId() {
		return id;
	}

	public Child getChild() {
		return child;
	}

	public void setChild(Child child) {
		this.child = child;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public ActivityType getActivitytype() {
		return activitytype;
	}

	public void setActivitytype(ActivityType activitytype) {
		this.activitytype = activitytype;
	}

	public Activity(){
		
	}
}
